﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presenters.CollectControl;

namespace University.Workshop.Presentation.CollectControl
{
    /// <summary>
    /// Interaction logic for ReadPayment.xaml
    /// </summary>
    public partial class ReadPayment : Page, IReadPaymentView
    {
        PresenterReadPayment pReadCharge;

        public ReadPayment(Model.Payment pay)
        {
            InitializeComponent();
            pReadCharge = new PresenterReadPayment(this, pay);
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            App.Current.MainWindow.Title = "Ver Cobro";
        }

        #region IReadChargeView Members

        public void SystemMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Atencion!!!", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public void ErrorMessage(string MessageValue)
        {
            MessageBox.Show(App.Current.MainWindow, MessageValue, "Error!!!", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.RightAlign);
        }

        public DateTime PaymentDate
        {
            set
            {
                PaymentDateLbl.Content = value.ToShortDateString();
            }
        }

        public decimal TotalAmount
        {
            set
            {
                /*decimal monto = value;
                int entero = Convert.ToInt32(monto);
                TotalAmountLbl.Content = entero.ToString();*/

                TotalAmountLbl.Content = value;

            }
        }

        public string ClientId
        {
            set
            {
                KardexLbl.Content = value;
            }
        }

        /*public int PaymentID
        {
            set
            {
                
                //PaymentIdLbl.Content = value.ToString();
            }
        }*/
        /*public string Charges
        {
            set
            {
                ChargesLbl.Content = value;
            }
        }*/

        public string Names
        {
            set
            {
                SocioLbl.Content = value;
            }
        }

        public ICollection<Model.CollectControl> CollectFinded
        {
            set
            {
                ChargeFindedDgv.ItemsSource = null;
                ChargeFindedDgv.ItemsSource = value;
            }
        }

        #endregion

        //Cancel Button
        /*private void CancelBtn_Click_1(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new Charges.SearchPayments());
        }*/

    }
}
